﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;

namespace mscook.core.domain
{
    public abstract class Entity : BaseObject
    {
        public Entity()
        {
            Id = Guid.NewGuid().ToString();
            CreateTime = DateTime.Now;
            Version = 1;
        }

        public virtual string Id { get; set; }

        //public virtual DateTime CreateTime { get; protected set; }

        public virtual Int32 Version { get; protected set; }

        [RegularExpression(@"^[0-9]*$", ErrorMessage = "请填写正确的数字")]
        public virtual int EntityIndex { get; set; }
    }
}
